﻿@model Home.WebUI.Areas.Mythi.Controllers.ProductCreate
@{
    ViewBag.SidebarId = 31;
    ViewBag.Title = "新建案例";
    Layout = "~/Areas/Mythi/Views/Shared/_Layout.cshtml";
}
@section scripts{
     <script type="text/javascript" src="~/Scripts/ueditor1.2.5.0/editor_config.js"></script>
    <script type="text/javascript" src="~/Scripts/ueditor1.2.5.0/editor_all.js"></script>
      <script type="text/javascript" src="~/Scripts/jquery.validate.min.js"></script>
    <script type="text/javascript" src="~/Scripts/jquery.validate.extension.js"></script>
    <script type="text/javascript" src="~/Scripts/messages_zh.js"></script>
    <script type="text/javascript" src="~/Scripts/My97DatePicker/WdatePicker.js"></script>
    <script type="text/javascript">
        //var editor = new UE.ui.Editor();
        //editor.render("Body");
        //1.2.4以后可以使用一下代码实例化编辑器
        UE.getEditor('Body');
    </script>
    @Model.UniValidate.JsValidate
    }
@section loadend{}


                 <form class="form-horizontal" method="post" action="@Url.Action("Create")">
  <fieldset>
    <legend>案例内容</legend>
    <div class="control-group">
      <label class="control-label" for="Title" >标题</label>
      <div class="controls">
        @Html.TextBoxFor(m => m.Name)
      </div>
    </div>
      @foreach (var item in Model.Classifications)
      {
          <div class="control-group">
      <label class="control-label" for="Title" >@item.Name</label>
      <div class="controls">
        @Html.DropDownList(item.Name,new SelectList(item.Categorys.ToList(),"Id","Name",Model.ProductCategorys.Where(t=>t.Category.ClassificationId==item.Id).Select(t=>t.CategoryId).First()))
      </div>
    </div>
      }
     @* <div class="control-group">
      <label class="control-label" for="Title" >分类</label>
      <div class="controls">
        @Html.DropDownList("PNewsId",ViewBag.PNewsId as SelectList)
      </div>
    </div>*@
      <div class="control-group">
      <label class="control-label" for="Body" >内容</label>
      <div class="controls">
        @Html.TextAreaFor(m => m.Body)
      </div>
    </div>
       <div class="form-actions">
            <button type="submit" class="btn btn-primary">保存</button>
           <a href="@Url.Action("index")" class="btn">取消</a>
          </div>

  </fieldset>
</form>
